/**
 * IRecord.java
 * Copyright (C) 2011 Yuanyan<yuanyan.cao@gmail.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * For information on how to redistribute this software under
 * the terms of a license other than GNU General Public License
 * contact yuanyan.cao@gmail.com
 */
package edu.rabbit.kernel.table;

import java.util.List;


import edu.rabbit.DbEncoding;
import edu.rabbit.DbException;
import edu.rabbit.kernel.IVdbeMem;
import edu.rabbit.kernel.btree.IBtreeCursor;
import edu.rabbit.kernel.memory.IMemoryPointer;

/**
 * Parses current record in {@link IBtreeCursor} and allow acces to
 * fields.
 * 
 * @author Yuanyan<yanyan.cao@gmail.com>
 * 
 * 
 */
public interface IBtreeRecord {

    /**
     * @return the fieldsCount
     */
    int getFieldsCount();

    /**
     * @return
     */
    List<IVdbeMem> getFields();

    /**
     * @return
     */
    IMemoryPointer getRawRecord();

    /**
     * @param field
     * @return
     * @throws DbException
     */
    String getStringField(int field, DbEncoding enc) throws DbException;

    /**
     * @param field
     * @return
     */
    long getIntField(int field);

    /**
     * @param field
     * @return
     */
    double getRealField(int field);

}